package com.xxl.job.admin.core.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * Created by xuxueli on 16/9/30.
 */
@Entity
@Table(name = "IISP_BATCH_JOB_GROUP")
@NamedQueries({
	@NamedQuery(name = JobGroup.QUERYALL, query = "select g from JobGroup g")
})
public class JobGroup {
	public final static String QUERYALL = "JobGroup.ALL";


	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	private Long id;
    private String appName;
    private String title;
	@Column(name = "ORD")
    private int order;
    private int addressType;    // 执行器地址类型：0=自动注册、1=手动录入
    private String addressList;    // 执行器地址列表，多地址逗号分隔(手动录入)

    // registry list
	@ElementCollection
    private List<String> registryList;  // 执行器地址列表(系统注册)

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public List<String> getRegistryList() {
        return registryList;
    }

    public void setRegistryList(List<String> registryList) {
        this.registryList = registryList;
    }

    public int getAddressType() {
        return addressType;
    }

    public void setAddressType(int addressType) {
        this.addressType = addressType;
    }

    public String getAddressList() {
        return addressList;
    }

    public void setAddressList(String addressList) {
        this.addressList = addressList;
    }
}
